#include "chatserver.hpp"
#include "chatservice.hpp"
#include <iostream>
#include <signal.h>

void ResetHandler(int);

int main()
{   
    signal(SIGINT, ResetHandler);
    EventLoop loop;
    InetAddress addr("0.0.0.0", 8888);
    ChatServer server(&loop, addr, "ChatServer");

    server.Start();
    loop.loop();
    return 0;
}

void ResetHandler(int)
{
    ChatService::GetInstance()->Reset();
    exit(0);
}

